<?php


namespace app\api\model;


class Goods extends BaseModel {


    protected $hidden = ['weigh','address','longitude','latitude'];

    public function getGoodsList($where,$page,$pagesize=''){
        $pagesize = $pagesize ? $pagesize : $this->pagesize;
        $start = ( $page - 1 ) * $pagesize;
        return self::where($where)->order('id desc')->limit($start,$pagesize)->select();
    }


    public function getGoodsDetail($id){
        return self::where('id',$id)->find();
    }


}